<template>
  <div class="app-container">
    <div class="filter-container">
      <span>清除缓存用于更新菜单、权限等。</span>
      <el-button :loading="loading" type="primary" @click="subClear">清除缓存</el-button>
    </div>
  </div>
</template>

<script>
import { clearCatch } from '@/api/user'
export default {
  name: 'ClearCatch',
  data: function() {
    return {
      loading: false
    }
  },
  methods: {
    subClear() {
      this.loading = true
      clearCatch().then((res) => {
        this.loading = false
        if (res.code == 0) {
          this.$message.success('清除缓存成功')
        } else {
          this.$message.error(res.msg)
        }
      }).catch(() => {
        this.loading = false
        this.$message.error('清除缓存失败')
      })
    }
  }
}
</script>

<style scoped="scoped" type="scss">
.pagination-container {
  padding: 0px;
  padding-bottom: 16px;
}

.hoverbutton {
  width: 70px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  border-radius: 3px;
}

.hoverbutton:hover {
  border: 1px solid #999999;
}

.setcheckbox .el-checkbox {
  margin-bottom: 10px;
}

.searchform .el-form-item {
  margin-bottom: 0px;
  min-width: 280px;
}
.el-table .cell{
  padding-right: 0px !important;
}
</style>
